Ext.onReady(function() {
			Ext.QuickTips.init();
			Ext.form.Field.prototype.msgTarget = 'under';
			var zhichenRender = function(val) {
				if (val == "教授") {
					return "教授";
				} else if (val == "副教授") {
					return "副教授";
				} else if (val == "讲师") {
					return "讲师";
				} else if (val == "助教") {
					return "助教";
				}
			};

			var zhichenstore = new Ext.data.SimpleStore( {
				fields : [ "retrunValue", "displayText" ],
				data : [ [ '教授', '教授' ], [ '副教授', '副教授' ], [ '讲师', '讲师' ],
						[ '助教', '助教' ] ]
			});

			var system = new Ext.data.Record.create( [ {
				name : 'systems_id',
				type : 'int'
			}, {
				name : 'systems_name',
				type : 'string'
			}, {
				name : 'systems_code',
				type : 'string'
			}, {
				name : 'systems_sysFlag',
				type : 'int'
			}, ])
			var systemsstore = new Ext.data.Store( {
				proxy : new Ext.data.HttpProxy( {
					url : '/schedule/querySystems'
				}),
				reader : new Ext.data.JsonReader( {
					totalProperty : 'totalProperty',
					root : 'root'
				}, system),
				remoteSort : true
			});
			systemsstore.load( {
				params : {
					start : 0,
					limit : 30
				}
			});

			var teacher = new Ext.data.Record.create( [ {
				name : 'teachers_id',
				type : 'int'
			}, {
				name : 'teachers_systems.systems_name',
				type : 'string'
			}, {
				name : 'teachers_name',
				type : 'string'
			}, {
				name : 'teachers_password',
				type : 'string'
			}, {
				name : 'teachers_zhichen',
				type : 'string',
				renderer : zhichenRender
			}, {
				name : 'teachers_systems.systems_id',
				type : 'int'
			}, {
				name : 'teachers_sysFlag',
				type : 'string'
			}, {
				name : 'teachers_code',
				type : 'string'
			}, ]);

			var teacherstore;
			function getData(val) {
				var url = "/schedule/queryTeachers?flag="
						+ encodeURI(encodeURI(val));
				teacherstore = new Ext.data.Store( {
					id : "teacher_id",
					proxy : new Ext.data.HttpProxy( {
						url : url
					}),
					reader : new Ext.data.JsonReader( {
						totalProperty : 'totalProperty',
						root : 'root'
					}, teacher),
					remoteSort : true
				});
				if (val != undefined) {
					grid.reconfigure(teacherstore, cols);
				}
				teacherstore.load( {
					params : {
						start : 0,
						limit : 15
					}
				});
			}
			;
			getData();

			var sm = new Ext.grid.CheckboxSelectionModel();
			var cols = new Ext.grid.ColumnModel( [ new Ext.grid.RowNumberer(),
					sm, {
						header : '教师姓名',
						dataIndex : 'teachers_name'
					}, {
						header : '教师职称',
						dataIndex : 'teachers_zhichen',
						renderer : zhichenRender
					}, {
						header : '所属院系',
						dataIndex : 'teachers_systems.systems_name'
					} ]);
			cols.defaultSortable = true;

			var courses = new Ext.data.Record.create( [ {
				name : 'course_id',
				type : 'int'
			}, {
				name : 'course_name',
				type : 'string'
			}, {
				name : 'course_code',
				type : 'string'
			} ]);
			var coursestore = new Ext.data.Store( {
				proxy : new Ext.data.HttpProxy( {
					url : '/schedule/queryCourse'
				}),
				reader : new Ext.data.JsonReader( {
					totalProperty : 'totalProperty',
					root : 'root'
				}, courses),
				remoteSort : true
			});
			coursestore.load();
			var courseSm = new Ext.grid.CheckboxSelectionModel();
			var courseCols = new Ext.grid.ColumnModel( [
					new Ext.grid.RowNumberer(), courseSm, {
						header : '课程名称',
						dataIndex : 'course_name'
					}, {
						header : '课程编号',
						dataIndex : 'course_code'
					} ]);
			courseCols.defaultSortable = true;
			var teachers_ids="";

			var courseGrid = new Ext.grid.GridPanel(
					{
						title : '课程信息列表',
						region : 'west',
						buttonAlign : "left",
						width : 450,
						height : 460,
						loadMask : true,
						store : coursestore,
						disableSelection : false,
						cm : courseCols,
						sm : courseSm,
						viewConfig : {
							forceFit : true
						},
						buttons : [ {
							text : "添加关联",
							listeners : {
								click : function() {
									var course_ids = "";
									var records = courseGrid.getSelectionModel()
											.getSelections();
									if ("" == records) {
										Ext.MessageBox.alert("提示", "请选择要添加课程");
									} else {
										for ( var i = 0; i < records.length; i++) {
											course_ids += records[i]
													.get("course_id")
													+ ",";
										};
										Ext.Ajax
												.request( {
													url : '/schedule/addToTeachersRCourse',
													params : {
														teachers_ids : teachers_ids,
														course_ids : course_ids
													},
													method : 'POST',
													success : function(
															form,
															action) {
														Ext.Msg
																.alert(
																		"系统消息",
																		"添加关联成功",
																		function() {
																			addToCourseWin.close();
																			window.parent.frames['mainFrame'].location
																			.reload('queryTeacher.jsp');
																		},
																		this);
													},
													failure : function(
															form,
															action) {
														Ext.Msg
																.alert(
																		"系统消息",
																		"添加关联失败",
																		function() {
																			addToCourseWin.close();
																			window.parent.frames['mainFrame'].location
																			.reload('queryTeacher.jsp');
																		},
																		this);
													}
												});
									
									}
								}
							}

						},{

							text : "取消关联",
							listeners : {
								click : function() {
									var course_ids = "";
									var records = courseGrid.getSelectionModel()
											.getSelections();
									if ("" == records) {
										Ext.MessageBox.alert("提示", "请选择要取消关联的课程");
									} else {
										for ( var i = 0; i < records.length; i++) {
											course_ids += records[i]
													.get("course_id")
													+ ",";
										};
										Ext.Ajax
												.request( {
													url : '/schedule/delFromTeachersRCourse',
													params : {
														teachers_ids : teachers_ids,
														course_ids : course_ids
													},
													method : 'POST',
													success : function(
															form,
															action) {
														Ext.Msg
																.alert(
																		"系统消息",
																		"取消关联成功",
																		function() {
																			addToCourseWin.close();
																			window.parent.frames['mainFrame'].location
																			.reload('queryTeacher.jsp');
																		},
																		this);
													},
													failure : function(
															form,
															action) {
														Ext.Msg
																.alert(
																		"系统消息",
																		"取消关联失败",
																		function() {
																			addToCourseWin.close();
																			window.parent.frames['mainFrame'].location
																			.reload('queryTeacher.jsp');
																		},
																		this);
													}
												});
									
									}
								}
							}

						
						}],
						bbar : new Ext.PagingToolbar( {
							store : coursestore,
							pageSize : 15,// 页大小
							displayInfo : true,// 是否显示displayMsg
							displayMsg : "本页显示第{0}条到第{1}条的记录,一共{2}条",
							emptyMsg : "没有记录"// 如果没有记录，则显示该文本
						})
					});
			var addToCourseWin = new Ext.Window( {
				layout : 'fit',
				title : '教师信息',
				width : 450,
				height : 480,
				resizable : true,
				closeAction : 'close',
				plain : true,
				items : courseGrid,
				listeners : {
					close : function(w) {
						w.restore();
						window.parent.frames['mainFrame'].location
						.reload('queryTeacher.jsp');
					},
					maximize : function(w) {
					}
				}
			});
			var addToCourse = function(val) {
				addToCourseWin.show();
			}

			var openwin = function() {
				var teacherform = new Ext.form.FormPanel(
						{
							region : 'center',
							frame : true,
							layout : "form", // 整个大的表单是form布局
							labelWidth : 65,
							labelAlign : "right",
							maximizable : true,
							items : [ { // 行1
										layout : "column", // 从左往右的布局
										items : [
												{
													columnWidth : .8,
													layout : "form",
													items : [ {
														xtype : "textfield",
														name : "teachers.teachers_name",
														allowBlank : false,
														validateOnBlur : true,
														fieldLabel : "教师姓名",
														width : 240
													} ]
												},
												{
													columnWidth : .8,
													layout : "form",
													items : [ {
														xtype : "hidden",
														name : "teachers.teachers_code",
														fieldLabel : "教师编号",
														width : 100
													} ]
												} ]
									}, { // 行2
										layout : "column",
										items : [ {
											columnWidth : .8,
											layout : "form",
											items : [ {
												xtype : 'combo',
												store : systemsstore,
												valueField : "systems_id",
												mode : 'local',
												forceSelection : true,
												emptyText : '选择所属院系',
												hiddenName : 'teachers.teachers_systems.systems_id',
												displayField : "systems_name",
												editable : false,
												triggerAction : 'all',
												allowBlank : false,
												validateOnBlur : true,
												fieldLabel : '所属院系',
												width : 240

											} ]
										} ]
									}, { // 行3

										columnWidth : .8,
										layout : 'form',
										border : false,
										items : [ {
											xtype : 'combo',
											store : zhichenstore,
											valueField : "retrunValue",
											displayField : "displayText",
											mode : 'local',
											forceSelection : true,
											blankText : '请选择教师职称',
											emptyText : '选择职称',
											hiddenName : 'teachers.teachers_zhichen',
											editable : false,
											triggerAction : 'all',
											allowBlank : false,
											validateOnBlur : true,
											fieldLabel : '教师职称',
											width : 240
										} ]
									}, {// 行4
										buttonAlign : "right",
										buttons : [
												{
													text : "提交",
													handler : function() {
														if (teacherform.form
																.isValid()) {
															teacherform.form
																	.submit( {
																		waitTitle : '请稍候',
																		waitMsg : '正在保存......',
																		url : '/schedule/addTeachers',
																		success : function(
																				form,
																				action) {
																			Ext.Msg
																					.alert(
																							"系统消息",
																							action.result.msg,
																							function() {
																								form
																										.reset();
																								win
																										.close();
																								teacherstore
																										.reload();
																								grid
																										.resumeEvents();
																							},
																							this);
																		},
																		failure : function(
																				form,
																				action) {
																			Ext.Msg
																					.alert(
																							'系统消息',
																							action.result.msg);
																			form
																					.reset();
																			win
																					.close();
																		}
																	})
														}

													}
												},
												{
													text : "重置",
													listeners : {
														click : function() {
															teacherform.form
																	.reset()
														}
													}
												} ]
									} ]

						});

				var win = new Ext.Window( {
					layout : 'fit',
					title : '教师信息',
					width : 420,
					height : 180,
					resizable : true,
					closeAction : 'close',
					plain : true,
					items : teacherform,
					listeners : {
						close : function(w) {
							w.restore();
						},
						maximize : function(w) {
						}
					}
				}).show();

			};

			var grid = new Ext.grid.GridPanel(
					{
						title : '教师信息列表',
						region : 'center',
						buttonAlign : "left",
						listeners : {
							"rowdblclick" : function(grid, rowIndex, e) {
								var records = grid.getSelectionModel()
										.getSelections();
								var systemsform = new Ext.form.FormPanel(
										{
											region : 'center',
											frame : true,
											layout : "form", // 整个大的表单是form布局
											labelWidth : 65,
											labelAlign : "right",
											maximizable : true,
											items : [
													{ // 行1
														layout : "column", // 从左往右的布局
														items : [
																{
																	columnWidth : .8,
																	layout : "form",
																	items : [ {
																		xtype : "textfield",
																		value : records[0]
																				.get("teachers_name"),
																		allowBlank : false,
																		validateOnBlur : true,
																		name : "teachers.teachers_name",
																		fieldLabel : "教师名称",
																		blankText : '必须填写',
																		width : 240
																	} ]
																},
																{
																	xtype : "hidden",
																	name : "teachers.teachers_id",
																	value : records[0]
																			.get("teachers_id"),
																	allowBlank : false
																},
																{
																	xtype : "hidden",
																	name : "teachers.teachers_sysFlag",
																	value : records[0]
																			.get("teachers_sysFlag"),
																	allowBlank : false
																},
																{
																	columnWidth : .4,
																	layout : "form",
																	items : [
																			{
																				xtype : "hidden",
																				allowBlank : false,
																				blankText : '必须填写',
																				value : records[0]
																						.get("teachers_code"),
																				name : "teachers.teachers_code",
																				fieldLabel : "教师编号",
																				width : 120
																			},
																			{
																				xtype : "hidden",
																				allowBlank : false,
																				blankText : '必须填写',
																				value : records[0]
																						.get("teachers_password"),
																				name : "teachers.teachers_password",
																				fieldLabel : "教师编号",
																				width : 120
																			} ]
																} ]
													},
													{
														// 行2
														layout : "column",
														items : [ {
															columnWidth : .8,
															layout : "form",
															items : [ {
																xtype : 'combo',
																store : systemsstore,
																mode : 'local',
																valueField : "systems_id",
																value : records[0]
																		.get("teachers_systems.systems_id"),
																forceSelection : true,
																hiddenName : 'teachers.teachers_systems.systems_id',
																displayField : "systems_name",
																editable : false,
																triggerAction : 'all',
																allowBlank : false,
																validateOnBlur : true,
																fieldLabel : '所属院系',
																width : 240
															} ]
														} ]

													}, {// 行2

														layout : "column",
														items : [ {
															columnWidth : .8,
															layout : "form",
															items : [ {
																xtype : 'combo',
																store : zhichenstore,
																valueField : "retrunValue",
																displayField : "displayText",
																mode : 'local',
																forceSelection : true,
																blankText : '请选择教师职称',
																emptyText : '选择职称',
																value : zhichenRender(records[0]
																		.get("teachers_zhichen")),
																forceSelection : true,
																hiddenName : 'teachers.teachers_zhichen',
																editable : false,
																triggerAction : 'all',
																allowBlank : false,
																validateOnBlur : true,
																fieldLabel : '教师职称',
																width : 240
															} ]
														} ]

													}, {// 行2

														buttonAlign : "right",
														buttons : [
																{
																	text : "修改",
																	handler : function() {
																		systemsform.form
																				.submit( {
																					waitTitle : '请稍候',
																					waitMsg : '正在保存......',
																					url : '/schedule/addTeachers',
																					method : "POST",
																					success : function(
																							form,
																							action) {
																						Ext.Msg
																								.alert(
																										"系统消息",
																										action.result.msg,
																										function() {
																											win
																													.close();
																											teacherstore
																													.reload();
																										},
																										this);
																					},
																					failure : function(
																							form,
																							action) {
																						Ext.Msg
																								.alert(
																										'系统消息',
																										action.result.msg);
																						win
																								.close();
																						teacherstore
																								.reload();
																					}
																				})

																	}
																},
																{
																	text : "重置",
																	listeners : {
																		click : function() {
																			systemsform.form
																					.reset()
																		}
																	}
																} ]
													} ]
										});
								var win = new Ext.Window( {
									layout : 'fit',
									title : '院系信息',
									width : 420,
									height : 180,
									resizable : true,
									closeAction : 'close',
									plain : true,
									items : systemsform,
									listeners : {
										close : function(win) {
											// 关键部分：关闭窗口前先还原,滚动条才不会消失
										win.restore();
									},
									maximize : function(win) {
										// 关键部分：最大化后需要将窗口重新定位，否则窗口会从最顶端开始最大化
										// w.setPosition(document.body.scrollLeft,document.body.scrollTop);
									}
									}
								});
								win.show();
							}
						},
						buttons : [
								{
									text : "新增",
									listeners : {
										click : function() {
											openwin();
										}
									}
								},
								{
									text : "删除",
									listeners : {
										click : function() {
											var ids = "";
											var records = grid
													.getSelectionModel()
													.getSelections();
											if ("" == records) {
												Ext.MessageBox.alert("提示",
														"请选择要删除的记录");
											} else {
												for ( var i = 0; i < records.length; i++) {

													ids += records[i]
															.get("teachers_id")
															+ ",";
												}
												;
												Ext.MessageBox
														.confirm(
																"确认删除",
																"确认删除所选数据？",
																function(button) {
																	if (button == "yes") {
																		Ext.Ajax
																				.request( {
																					url : '/schedule/deleteTeachers',
																					params : {
																						ids : ids
																					},
																					method : 'POST',
																					success : function(
																							form,
																							action) {
																						Ext.Msg
																								.alert(
																										"系统消息",
																										"删除成功",
																										function() {
																											grid
																													.resumeEvents();
																											teacherstore
																													.reload();
																										},
																										this);
																					},
																					failure : function(
																							form,
																							action) {
																						Ext.Msg
																								.alert(
																										'系统消息',
																										"删除失败");
																						grid
																								.resumeEvents();
																						teacherstore
																								.reload();
																					},

																					scope : this
																				});
																	}
																}, this);
											}
										}
									}
								},
								{

									text : "修改",
									listeners : {
										click : function() {
											var record = grid
													.getSelectionModel()
													.getSelected();
											if (!record) {
												Ext.Msg.alert("提示",
														"请先选择要修改的行!");
												return;
											}
											var changeform = new Ext.form.FormPanel(
													{
														region : 'center',
														frame : true,
														layout : "form", // 整个大的表单是form布局
														labelWidth : 65,
														labelAlign : "right",
														maximizable : true,

														items : [ { // 行1
																	layout : "column", // 从左往右的布局
																	items : [
																			{
																				columnWidth : .8,
																				layout : "form",
																				items : [ {
																					xtype : "textfield",
																					name : "teachers.teachers_name",
																					value : record
																							.get("teachers_name"),
																					allowBlank : false,
																					validateOnBlur : true,
																					fieldLabel : "教师姓名",
																					width : 240
																				} ]
																			},
																			{
																				columnWidth : .8,
																				layout : "form",
																				items : [
																						{
																							xtype : "hidden",
																							name : "teachers.teachers_code",
																							value : record
																									.get("teachers_code"),
																							allowBlank : false,
																							validateOnBlur : true,
																							fieldLabel : "教师编号",
																							width : 120
																						},
																						{
																							xtype : "hidden",
																							name : "teachers.teachers_id",
																							value : record
																									.get("teachers_id"),
																							fieldLabel : "教师ID",
																							width : 120
																						},
																						{
																							xtype : "hidden",
																							name : "teachers.teachers_password",
																							value : record
																									.get("teachers_password"),
																							fieldLabel : "教师ID",
																							width : 120
																						},
																						{
																							xtype : "hidden",
																							name : "teachers.teachers_sysFlag",
																							value : record
																									.get("teachers_sysFlag"),
																							fieldLabel : "数据标志",
																							width : 120
																						} ]
																			} ]
																}, { // 行2
																	layout : "column",
																	items : [ {
																		columnWidth : .8,
																		layout : "form",
																		items : [ {
																			xtype : 'combo',
																			store : systemsstore,
																			valueField : "systems_id",
																			value : record
																					.get("teachers_id"),
																			mode : 'local',
																			forceSelection : true,
																			hiddenName : 'teachers.teachers_systems.systems_id',
																			displayField : "systems_name",
																			editable : false,
																			triggerAction : 'all',
																			allowBlank : false,
																			validateOnBlur : true,
																			fieldLabel : '所属院系',
																			width : 240
																		} ]
																	} ]
																}, { // 行3

																	columnWidth : .8,
																	layout : 'form',
																	border : false,
																	items : [ {
																		xtype : 'combo',
																		store : zhichenstore,
																		valueField : "retrunValue",
																		displayField : "displayText",
																		mode : 'local',
																		value : zhichenRender(record
																				.get("teachers_zhichen")),
																		forceSelection : true,
																		blankText : '请选择教师职称',
																		hiddenName : 'teachers.teachers_zhichen',
																		editable : false,
																		triggerAction : 'all',
																		allowBlank : false,
																		validateOnBlur : true,
																		fieldLabel : '教师职称',
																		width : 240
																	} ]
																}, {// 行2
																	buttonAlign : "right",
																	buttons : [
																			{
																				text : "修改",
																				handler : function() {
																					if (changeform.form
																							.isValid()) {
																						changeform.form
																								.submit( {
																									waitTitle : '请稍候',
																									waitMsg : '正在保存......',
																									url : '/schedule/addTeachers',
																									success : function(
																											form,
																											action) {
																										Ext.Msg
																												.alert(
																														"系统消息",
																														action.result.msg,
																														function() {
																															changeform.form
																																	.reset();
																															changewin
																																	.close();
																															grid
																																	.resumeEvents();
																															teacherstore
																																	.reload();
																														},
																														this);
																									},
																									failure : function(
																											form,
																											action) {
																										Ext.Msg
																												.alert(
																														'系统消息',
																														action.result.msg);
																										grid
																												.resumeEvents();
																										changeform.form
																												.reset();
																										changewin
																												.close();
																									}
																								})
																					}

																				}
																			},
																			{
																				text : "重置",
																				listeners : {
																					click : function() {
																						changeform.form
																								.reset()
																					}
																				}
																			} ]
																} ]

													});

											var changewin = new Ext.Window( {
												layout : 'fit',
												title : '教师信息',
												width : 420,
												height : 180,
												resizable : true,
												closeAction : 'close',
												plain : true,
												items : changeform,
												listeners : {
													close : function(w) {
														w.restore();
													},
													maximize : function(w) {

													}
												}
											});

											changewin.show();
										}

									}

								},
								{

									text : "管理所选老师教授的课程",
									listeners : {
										click : function() {
											var records = grid
													.getSelectionModel()
													.getSelections();
											if ("" == records) {
												Ext.MessageBox.alert("提示",
														"请选择要添加课程的老师");
											} else {
												for ( var i = 0; i < records.length; i++) {

													teachers_ids += records[i]
															.get("teachers_id")
															+ ",";
												};
												Ext.MessageBox
														.confirm(
																"确认管理",
																"确认管理所选数据？",
																function(button) {
																	if (button == "yes") {
																		addToCourse(teachers_ids);
																	}
																	else{
																	}
																}, this);
											}
										}
									}
								}

						],
						loadMask : true,
						store : teacherstore,
						cm : cols,
						sm : new Ext.grid.RowSelectionModel( {
							singleSelect : false
						}),
						viewConfig : {
							forceFit : true
						},
						bbar : new Ext.PagingToolbar( {
							store : teacherstore,
							pageSize : 15,// 页大小
							displayInfo : true,// 是否显示displayMsg
							displayMsg : "本页显示第{0}条到第{1}条的记录,一共{2}条",
							emptyMsg : "没有记录"// 如果没有记录，则显示该文本
						})

					});

			var form = new Ext.form.FormPanel( {
				region : "north",
				id : "form",
				width : 650,
				height : 60,
				hideBorders : true,
				layout : "form", // 整个大的表单是form布局
				labelWidth : 80,
				labelAlign : "right",
				items : [ { // 行1
					layout : "column", // 从左往右的布局
					hideBorders : true,
					items : [ {
						columnWidth : .3,
						layout : "form",
						items : [ {
							xtype : 'combo',
							store : systemsstore,
							valueField : "systems_name",
							mode : 'local',
							forceSelection : true,
							hiddenName : 'flag2',
							displayField : "systems_name",
							editable : false,
							triggerAction : 'all',
							allowBlank : false,
							validateOnBlur : true,
							fieldLabel : '所属院系',
							width : 240
						} ]
					}, {
						columnWidth : .3,
						layout : "form",
						items : [ {
							xtype : 'combo',
							store : zhichenstore,
							valueField : "retrunValue",
							displayField : "displayText",
							mode : 'local',
							forceSelection : true,
							blankText : '请选择教师职称',
							emptyText : '选择职称',
							hiddenName : 'flag0',
							editable : false,
							triggerAction : 'all',
							fieldLabel : '教师职称',
							width : 120

						} ]
					}, {
						columnWidth : .3,
						layout : "form",
						items : [ {
							xtype : "textfield",
							name : "flag1",
							fieldLabel : "教师名称",
							width : 120
						} ]
					} ]
				} ],
				tbar : [
						new Ext.Toolbar.TextItem('查询'),
						{
							xtype : "tbfill"
						},
						{
							pressed : true,
							text : '查询',
							listeners : {
								click : function() {
									Ext.StoreMgr.remove('professional_id');
									var flag0 = Ext.getCmp("form").getForm()
											.findField('flag0').getValue();
									var flag1 = Ext.getCmp("form").getForm()
											.findField('flag1').getValue();
									var flag2 = Ext.getCmp("form").getForm()
											.findField('flag2').getValue();
									if (flag1 == "") {
										flag1 = "-";
									}
									;
									if (flag0 == "") {
										flag0 = "-";
									}
									;
									if (flag2 == "") {
										flag2 = "-";
									}
									;
									var flag = "" + flag0 + "," + flag1 + ","
											+ flag2;
									getData(flag);// 提交方法
								}
							}
						}, {
							xtype : "tbseparator"
						}, {
							pressed : true,
							text : '置空',
							listeners : {
								click : function() {
									form.form.reset();
								}
							}
						} ]
			});

			var viewport = new Ext.Viewport( {
				layout : 'border',
				title : '列表',
				items : [ form, grid, {
					region : 'south',
					contentEl : 'foot'
				} ]
			});
		});